// Surface
// (c) jimon game studio

#ifndef JEH_CSURFACE
#define JEH_CSURFACE

#include "ISurface.h"

namespace je
{
	namespace scene
	{
		//! Surface
		class CSurface:public je::scene::ISurface
		{
		protected:
			video::IRender * CurrentRender;
			media::jeSharedMaterial * CurrentSharedMaterial;
			u1 CurrentUseUniqueMaterial;

			video::RenderOperationType CurrentOperationType;
			video::jeRenderOperation * CurrentOperation;
		public:
			//! Constructor
			CSurface(video::IRender * Render,video::RenderOperationType Type,video::jeRenderOperation * Operation);

			//! Destructor
			~CSurface();

			//! Set Material Resource
			void SetMaterialResource(media::jeMaterialResource * MaterialResource,u1 UseUniqueMaterial = false,u1 UseUniqueTextures = true,u1 UseUniqueShader = true);

			//! Get Material Resource
			media::jeMaterialResource * GetMaterialResource();

			//! Get Shared Material Resource
			media::jeSharedMaterial * GetSharedMaterialResource();

			//! Get Render
			video::IRender * GetRender();

			//! Get Render Operation
			video::jeRenderOperation * GetRenderOperation();

			//! Get Render Operation Type
			video::RenderOperationType GetRenderOperationType();

			//! Get Material
			video::jeMaterial * GetMaterial();

			//! On Render
			void OnRender(const jeMatrix4f & AbsoluteModelMatrix);
		};
	}
}

#endif
